package cn.dt70.dao.aqbReward;

import cn.dt70.pojo.AqbReward;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface AqbRewardMapper {

    //投资后得到奖励金
    int getReward(AqbReward aqbReward) throws Exception;
    //修改奖励金的状态
    int udpRewardStatus(Integer rewardId) throws Exception;

    //得到用户获得的已经激活的奖励金总数
    int couldUseReward(@Param("userId") Integer userId,
                       @Param("rewardType") Integer rewardType) throws Exception;

    //展示用户的奖励金流水
    List<AqbReward> rewardList(@Param("userId") Integer userId,
                               @Param("rewardType") Integer rewardType,
                               @Param("startDay") Integer startDay,
                               @Param("indexNo") Integer indexNo,
                               @Param("pageSize") Integer pageSize
    ) throws Exception;

    //根据状态查询奖励金
    List<AqbReward> queryByStatus(@Param("userId") Integer userId,
                                  @Param("rewardType") Integer rewardType,
                                  @Param("startDay") Integer startDay) throws Exception;

    //根据用户查询一段时间的奖励金
    List<AqbReward> queryByStatusTime(@Param("userId") Integer userId,
                                      @Param("rewardType") Integer rewardType,
                                      @Param("begin") Date begin,
                                      @Param("end") Date end) throws Exception;

    //展示用户的奖励金流水
    List<AqbReward> rewardListBetweenTime(@Param("userId") Integer userId,
                                          @Param("rewardType") Integer rewardType,
                                          @Param("indexNo") Integer indexNo,
                                          @Param("pageSize") Integer pageSize,
                                          @Param("begin") Date begin,
                                          @Param("end") Date end) throws Exception;

//    获得用户的奖励金条数
    int rewardCount(@Param("userId") Integer userId,
                    @Param("rewardType") Integer rewardType,
                    @Param("startDay") Integer startDay) throws Exception;

    //得到用户的奖励金条数在一定的时间内
    int rewardCountTime(@Param("userId") Integer userId,
                        @Param("rewardType") Integer rewardType,
                        @Param("begin") Date begin,
                        @Param("end") Date end) throws Exception;

//    根据用户id查询所有的信息

    List<AqbReward> rewardLists(@Param("userId") Integer userId) throws Exception;
//根据用户查询以及使用的奖励金
int haveUsedReward(@Param("userId") Integer userId) throws Exception;

//奖励金的所有的信息
    AqbReward rewardInformation(@Param("userId") Integer userId) throws Exception;


}
